package cn.wolfcode.user.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 李新雨的项目86176
 * @version 1.0
 * @date 2024-11-06 16:38
 */
@WebServlet("/loginOut")
public class LoginOutServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        req.setCharacterEncoding("utf-8");
        resp.setCharacterEncoding("utf-8");
        req.getSession().removeAttribute("USER_IN_SESSION");
        resp.sendRedirect("/login.jsp");
    }
}
